local ListViewCellModelMetatable = {}

function ListViewCellModelMetatable:dispatchEvent(event, params)
    self.listview:onCellEvent(event, params)
end

function ListViewCellModelMetatable:setShareData(shareData)
    self.listview:setCellsShareData(shareData)
end

function ListViewCellModelMetatable:getShareData()
    return self.listview:getCellsShareData()
end

function ListViewCellModelMetatable:notifyCellsShareDataChange(index)
    self.listview:notifyCellsShareDataChange(index)
end

function ListViewCellModelMetatable:setFoucsIndex(index)
    self.listview:setFoucsIndex(index)
end

function ListViewCellModelMetatable:getFoucsIndex(index)
    return self.listview:getFoucsIndex()
end

function ListViewCellModelMetatable:isFoucs()
    return self.index == self.listview:getFoucsIndex()
end

function ListViewCellModelMetatable:getIndex()
    return self.index
end

-- 设置状态
function ListViewCellModelMetatable:setUIState(key, value)
    if not self.uiState then
        self.uiState = {}
    end
    self.uiState[key] = value
end

function ListViewCellModelMetatable:getUIState(key)
    if self.uiState then
        return self.uiState[key]
    end
end

function ListViewCellModelMetatable:setSelected(b)
    self:setUIState("selected", b)
end

function ListViewCellModelMetatable:isSelected()
    return self:getUIState("selected")
end


return ListViewCellModelMetatable